//
//  OptionsViewController.m
//  Tapper
//
//  Created by iD Student on 7/10/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "OptionsViewController.h"

@interface OptionsViewController ()

@end

@implementation OptionsViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	enemyList = [[NSMutableArray alloc] init];
    [enemyList addObject:@"Voltorb"];
    [enemyList addObject:@"Bomb-omb"];
    [enemyList addObject:@"TNT"];
    [enemyList addObject:@"Circle!"];
    enemyPicker.delegate = self;
    enemyPicker.dataSource = self;
}
-(NSInteger) numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
    return 1;
}
-(NSInteger) pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
    return enemyList.count;
}

-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
    return [enemyList objectAtIndex:row];
}

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
    selectedRow = row;
}

-(IBAction)changePressed:(id)sender
{
    NSString *selectedEnemy = [enemyList objectAtIndex:selectedRow];
    if([selectedEnemy compare:@"Voltorb"] == NSOrderedSame)
    {
        enemyKind=1;
        enemyImage.image = [UIImage imageNamed:@"Voltorb.png"];
    }
    if([selectedEnemy compare:@"Bomb-omb"] == NSOrderedSame)
    {
        
    }
    if([selectedEnemy compare:@"TNT"] == NSOrderedSame)
    {
        
    }
    if([selectedEnemy compare:@"Circle!"] == NSOrderedSame)
    {
        
    }
    
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
